package com.huatai.bi.controller.bigScreen;

import com.huatai.bi.query.QueryImageQuery;
import com.huatai.bi.service.BigScreenImageService;
import com.huatai.common.api.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @BelongsProject: itc-airport-cloud
 * @BelongsPackage: com.huatai.bi.controller.bigScreen
 * @Author: hecaiy
 * @CreateTime: 2024-07-01  21:23
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("/image")
@Api(tags = "大屏图片管理(大屏)")
public class BigScreenImageController {
    @Autowired
    private BigScreenImageService bigScreenImageService;

    @PostMapping("/upload")
    @ApiOperation("上传图片")
    public R<String> uploadImage(@RequestParam(value = "file") MultipartFile file) throws Exception {
        return R.data(bigScreenImageService.uploadImageMinio(file));
    }

    @PostMapping("/getPage")
    @ApiOperation("分页查询图片")
    public R<Object> getPage(@RequestBody QueryImageQuery query) {
        return R.data(bigScreenImageService.getPage(query));
    }
}
